package com.z8fz.admin.food.service.impl;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.z8fz.admin.food.dao.FoodDao;
import com.z8fz.admin.food.dao.FoodTypeDao;
import com.z8fz.admin.food.model.Food;
import com.z8fz.admin.food.service.FoodService;
import com.z8fz.common.pager.PageModel;

@Service("b-foodServiceImpl")
public class FoodServiceImpl implements FoodService {
	
	
	public PageModel findFoods() {
		return foodDao.selectFoods();
	}

	public PageModel findType() {
		return foodTypeDao.selectType();
	}

	public int addFood(Food food) {
		food.setReadCount(0);
		foodTypeDao.insertFood(food);
		return 0;
	}
	
	public Food findFoodById(Integer id) {
		return foodDao.selectFoodById(id);
	}
	
	
	@Autowired
	private FoodDao foodDao;
	@Autowired FoodTypeDao foodTypeDao;
	
}
